<template>
  <div class="main_box">
    <CommonHeader title="平台提升意见"></CommonHeader>
    <van-form class="main_form" @submit="onSubmit">
        <div class="head">平台提升意见反馈</div>
        <van-cell-group>
          <van-field v-model="form.moduleName" :required="true" :rules="[{ required: true, message: ' ' }]" placeholder="请输入模块名称" />
        </van-cell-group>
        <van-cell-group style="margin:15px 0px">
          <van-field v-model="form.functionName" :required="true" :rules="[{ required: true, message: ' ' }]" placeholder="请输入功能点" />
        </van-cell-group>        
        <van-field
            v-model="form.content"
            :required="true"
            :rules="[{ required: true, message: ' ' }]"
            input-align="left"
            name="content"
            placeholder="请输入意见内容"
            maxlength="500"
            type="textarea"
            show-word-limit
            rows="6"
        >
        </van-field>
        <div class="btn_box">
            <van-button  round type="info" @click="submit">提 交</van-button>
        </div>
    </van-form>
  </div>
</template>

<script>
import CommonHeader from '@/components/commonHeader'
import { Toast } from 'vant'
export default {
  // eslint-disable-next-line
  name: 'AskHelp',
  components: {
    CommonHeader
  },
  data(){
    return{
        form:{
            employeeId:'',
            content:'',
            moduleName:'',
            functionName:''
        },
    }
  },
  created(){
    // this.onSubmit()
  },
  methods: {
    onSubmit(){
        const params = {
          employeeId: sessionStorage.getItem('employId'),
          moduleName: this.form.moduleName,
          functionName: this.form.functionName,
          content: this.form.content
      }
      this.$api.ptabnormal(params).then(res=>{
        if(res.errno === 200){
           Toast.success('提交成功');
            setTimeout(()=>{
              this.$router.go(-1)
            }, 1500)
        }else{
           Toast.fail(res.data);
        }
      })
    }
  },
}
</script>

<style scoped>
.main_box{
    min-height: 100vh;
    background-color: #f4f5fa;
}
.main_form{
    font-size:14px;
    color:#333;
    padding:15px;
}
.head{
  width: 100%;
  height: 44px;
  line-height: 44px;
  text-align: left;
  border-radius:5px;
  margin-bottom: 10px; 
  font-weight: 500; 
  font-family: PingFang SC;
  padding:0 16px;
  font-size:14px;
  color:#333;
  box-sizing: border-box;
}
.form_title{
    width: 100%;
    text-align: left;
    padding:10px 0;
}
.right_icon{
    display: inline-block;
    width: 8px;
    height: 15px;
    background: url("../../assets/image/select_icon.png") no-repeat;
    background-size: 100% 100%;
}
.btn_box >>> .van-button{
    width: 90%;
    margin: 50px 10px;
}
.black >>> .van-field__control:disabled,.black >>> .van-field__control[disabled]{
    color:#333!important;
    opacity: 1;
    -webkit-text-fill-color: #000;
    -webkit-opacity: 1;
}
</style>